package com.ayz.gateway.common.response;


import com.ayz.gateway.common.constants.GatewayServiceData;
import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName GatewayServiceDiscoveryResponse
 * @Description TODO: 网关服务发现响应
 * @Author 快乐的星球
 * @Date 2023/5/30 17:29
 * @Version 1.0
 **/
@Getter
@Setter
public class GatewayServiceDiscoveryResponse {
    /**
     * 指定网关业务组下网关服务的基础信息列表
     */
    private List<GatewayServiceData> gatewayServiceDataList;

    public GatewayServiceDiscoveryResponse(List<GatewayServiceData> gatewayServiceDataList) {
        this.gatewayServiceDataList = gatewayServiceDataList;
    }

    public GatewayServiceDiscoveryResponse() {
        this.gatewayServiceDataList=new ArrayList<>();
    }

    public void addGatewayServiceData(GatewayServiceData gatewayServiceData){
        this.gatewayServiceDataList.add(gatewayServiceData);
    }

    public void addGatewayServiceDataList(List<GatewayServiceData> gatewayServiceDataList){
        this.gatewayServiceDataList.addAll(gatewayServiceDataList);
    }
}
